<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>发票管理系统</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="assets/css/admin.css">
    <link rel="stylesheet" href="assets/css/app.css">
    <style>
        .star::before {
            content: '*';
            color: #F56C6C;
            margin-right: 0.020833rem;
        }

        .am-form-horizontal .am-radio {
            padding-top: 3px;
        }

        .am-ucheck-icons {
            line-height: 28px;
        }
    </style>
</head>
<body data-type="generalComponents">
<header class="am-topbar am-topbar-inverse admin-header">
    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">
            <li class="am-dropdown" data-am-dropdown data-am-dropdown-toggle>
                <a class="am-dropdown-toggle tpl-header-list-link" href="javascript:;">
                    <span class="tpl-header-list-user-nick">禁言小张</span>
                    <span class="tpl-header-list-user-ico">
              <img src="assets/img/user01.png">
            </span>
                </a>
                <ul class="am-dropdown-content">
                    <li>
                        <a href="login.html">
                            <span class="am-icon-power-off"></span> 退出</a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
</header>
<div class="tpl-page-container tpl-page-header-fixed">
    <div class="tpl-left-nav tpl-left-nav-hover">
        <div class="tpl-left-nav-list">
            <ul class="tpl-left-nav-menu">
                <li class="tpl-left-nav-item">
                    <a href="javascript:;" class="nav-link tpl-left-nav-link-list active">
                        <i class="am-icon-table"></i>
                        <span>发票管理</span>
                        <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                    </a>
                    <ul class="tpl-left-nav-sub-menu" style="display:block">
                        <li>
                            <a href="invoice-list.html">
                                <i class="am-icon-angle-right"></i>
                                <span>发票总览管理</span>
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <div class="tpl-content-wrapper">
        <div class="tpl-content-page-title" style="margin-bottom: 4px;">
            发票开具
        </div>
        <div class="tpl-portlet-components" id="baseinfoDiv">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    选择开票相关订单
                </div>
                <div class="tpl-portlet-input tpl-fz-ml">
                    <div class="portlet-input input-small input-inline">
                        <div class="input-icon right">
                        </div>
                    </div>
                </div>
            </div>
            <div class="tpl-block">
                <div class="am-g">
                    <div class="am-u-sm-6 am-u-md-3">
                        <div class="am-input-group am-input-group-sm">
                <span class="am-input-group-btn">
                  <span style="font-size: 14px;margin-right: 8px;margin-left: 8px">订单编号</span>
                </span>
                            <input type="text" class="am-form-field" placeholder="&nbsp;&nbsp;请输入订单编号"
                                   style="border: 1px solid #c2cad8;width: 68%;border-radius: 3px;">
                        </div>
                    </div>
                    <div class="am-u-sm-6 am-u-md-3">
                        <div class="am-input-group am-input-group-sm">
                <span class="am-input-group-btn">
                  <span style="font-size: 14px;margin-right: 8px;margin-left: 8px;">生成日期</span>
                </span>
                            <input type="text" class="am-form-field" data-am-datepicker placeholder="&nbsp;&nbsp;请选择日期"
                                   style="border: 1px solid #c2cad8;width: 68%;border-radius: 3px;">
                        </div>
                    </div>
                    <div class="am-u-sm-6 am-u-md-3">
                        <div class="am-input-group am-input-group-sm">
                <span class="am-input-group-btn">
                  <span style="font-size: 14px;margin-right: 8px;margin-left: 8px">凭证金额</span>
                </span>
                            <input type="text" class="am-form-field" placeholder="&nbsp;&nbsp;最低金额(万)"
                                   style="border: 1px solid #c2cad8;width: 32%;border-radius: 3px;">
                            <div class="am-form-field"
                                 style="width: 0%; border-radius: 3px;border: none;margin-left: 10px;">~
                            </div>
                            <input type="text" class="am-form-field" placeholder="&nbsp;&nbsp;最高金额(万)"
                                   style="border: 1px solid #c2cad8;width: 32%;border-radius: 3px;margin-left: 20px;">
                        </div>
                    </div>
                    <div class="am-u-sm-6 am-u-md-3">
                    </div>
                </div>
            </div>
            <div class="am-g">
                <div class="am-u-sm-12" id="orders">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main" >
                            <thead>
                            <tr>
                                <th></th>
                                <th class="table-title">订单编号</th>
                                <th class="table-author am-hide-sm-only">订单金额（元）</th>
                                <th class="table-date am-hide-sm-only">生成时间</th>
                            </tr>
                            </thead>


                            <tbody id="doc-modal-list">
                            <tr data-id="2" v-for="(allOrder) in page.data">
                                <td>
                                    <input type="radio" name="checkItem" data-am-ucheck @click="getOrder(allOrder.no,allOrder.total_amount)">
                                </td>
<!--                                <td class="am-hide-sm-only">{{++index}}</td>-->
                                <td >{{allOrder.no}}</td>
                                <td >{{allOrder.total_amount}}</td>
                                <td >{{allOrder.create_time}}</td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="am-cf">
                            <div class="am-fr">
                                <ul class="am-pagination tpl-pagination">
                                    <li >
                                        <a href="#" @click.prevent="toPage(page.currentPage - 1)">«</a>
                                    </li>
<!--                                    <li>-->
<!--                                        <a href="#" @click.prevent="toPage(page.currentPage - 2)" v-if="page.currentPage - 2 > page.currentPage">{{page.currentPage - 2}}</a>-->
<!--                                    </li>-->
                                    <li>
                                        <a href="#" @click.prevent="toPage(page.currentPage - 1)" v-if="page.currentPage - 1 > page.currentPage">{{page.currentPage - 1}}</a>
                                    </li>
                                    <li>
                                        <a href="#" @click.prevent="toPage(page.currentPage)">{{page.currentPage}}</a>
                                    </li>
                                    <li>
                                        <a href="#" @click.prevent="toPage(page.currentPage + 1)" >{{page.currentPage + 1}}</a>
                                    </li>
                                    <li>
                                        <a href="#" @click.prevent="toPage(page.currentPage + 2)" >{{page.currentPage + 2}}</a>
                                    </li>
                                    <li>
                                        <a href="#" @click.prevent="toPage(page.currentPage + 3)"  >{{page.currentPage + 3}}</a>
                                    </li>
                                    <li>
                                        <a href="#" @click.prevent="toPage(page.currentPage + 4)" >{{page.currentPage + 4}}</a>
                                    </li>
                                    <li>
                                        <a href="#" @click.prevent="toPage(page.currentPage + 1)">»</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <hr>
                    </form>
                </div>
            </div>
        </div>
        <div class="tpl-portlet-components" id="showDiv">
            <!-- 表单填写页面 -->
            <div class="tpl-block">
                <div class="">
                    <div class="portlet-title">
                        <div class="caption font-green bold">
                            抬头信息
                        </div>
                        <div class="tpl-portlet-input tpl-fz-ml">
                            <div class="portlet-input input-small input-inline">
                                <div class="input-icon right">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="tpl-block ">
                        <div class="am-g tpl-amazeui-form">
                            <div class="am-u-sm-12 am-u-md-6">
                                <form class="am-form am-form-horizontal">
                                    <div class="am-form-group" id="cate1">
                                        <label for="user-name" class="am-u-sm-3 am-form-label star"> 发票种类</label>
                                        <div class="am-u-sm-3" style="margin-top: 4px;font-size: 16px;"
                                             onclick="selectCategory('ordinary')">
                                            <label class="am-radio">
                                                <input type="radio" name="radio1"  @click="choiceOne" data-am-ucheck checked >
                                                普通增值税发票
                                            </label>
                                        </div>
                                        <div class="am-u-sm-6" style="margin-top: 4px;font-size: 16px;"
                                             onclick="selectCategory('appropriative')">
                                            <label class="am-radio">
                                                <input type="radio" name="radio1"  @click="choiceTwo" data-am-ucheck> 增值税专用发票
                                            </label>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="am-u-sm-12 am-u-md-6">
                                <form class="am-form am-form-horizontal">
                                    <div class="am-form-group" id="cate2">
                                        <label for="user-name" class="am-u-sm-3 am-form-label star"> 发票类型</label>
                                        <div class="am-u-sm-3" style="margin-top: 4px;font-size: 16px;"
                                             onclick="selectType('ele')">
                                            <label class="am-radio">
                                                <input type="radio" name="radio1" value="" @click="choiceOne" data-am-ucheck checked> 电子发票
                                            </label>
                                        </div>
                                        <div class="am-u-sm-6" style="margin-top: 4px;font-size: 16px;"
                                             onclick="selectType('paper')">
                                            <label class="am-radio">
                                                <input type="radio" name="radio1" value="" @click="choiceTwo" data-am-ucheck> 纸质发票
                                            </label>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <hr>
                        <div id="baseData">
                            <div id='invoice_ordinary_title' class="am-g tpl-amazeui-form">
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label star"> 抬头</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{baseData.title}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label">税号</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{baseData.taxNo}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <div id='invoice_appropriative_title' class="am-g tpl-amazeui-form" hidden>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label star"> 抬头</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{baseData.title}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label">税号</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{baseData.taxNo}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label star"> 开户银行</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{baseData.bankName}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label">开户账号</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{baseData.bankAccount}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label star"> 注册固定电话</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{baseData.phone}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label">注册场所地址</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{baseData.address}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <hr>
                            <div id='invoice_ele_addr' class="am-g tpl-amazeui-form">
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label star"> 邮箱</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{email}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label"></label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                <span id="selectEmail" style="color: #23abf0;cursor: pointer;">选择</span>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <div id='invoice_paper_addr'  class="am-g tpl-amazeui-form" hidden>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label star"> 邮寄地址</label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                {{address}}
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <div class="am-u-sm-12 am-u-md-6">
                                    <form class="am-form am-form-horizontal">
                                        <div class="am-form-group">
                                            <label for="user-name" class="am-u-sm-3 am-form-label"></label>
                                            <div class="am-u-sm-9" style="margin-top: 4px;font-size: 16px;">
                                                <span id="selectAddress"
                                                      style="color: #23abf0;cursor: pointer;">选择</span>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div style="text-align: center;margin-top:40px" ><div id="open">
                <a class="am-btn am-btn-default" href="invoice-list.html">取&nbsp;&nbsp;&nbsp;&nbsp; 消
                </a>

                <a  class="am-btn am-btn-primary" style="margin-left:20px" @click.prevent="open">提&nbsp;&nbsp;&nbsp;&nbsp; 交
                </a></div>
            </div>
        </div>
        <div class="tpl-portlet-components" id="resultDiv">
            <!-- 提交成功页面 -->
            <div class="tpl-block ">
                <div class="am-g tpl-amazeui-form">

                    <div class="am-u-sm-12 am-u-md-12">
                        <form class="am-form am-form-horizontal">
                            <div class="am-form-group">
                                <div class="am-u-sm-12" style="margin-top: 4px;text-align: center;margin-bottom: 20px;">
                                    <img src="assets/img/u105.png" alt="" style="width: 120px;">
                                </div>
                                <div class="am-u-sm-12"
                                     style="margin-top: 4px;font-size: 20px;text-align: center;font-weight: bold;margin-bottom: 20px;">
                                    提交申请成功
                                </div>
                                <div class="am-u-sm-12" style="color: #999;font-size:14px;text-align: center;">
                                    已通知审核人员尽快审核，最终结果将以站内信的方式告知您。
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div style="text-align: center;margin-top:40px">
                    <a class="am-btn am-btn-primary" href="invoice-list.html">返回列表</a>
                </div>
            </div>
        </div>
        <!-- 选择邮箱弹出框 -->
        <div class="am-modal am-modal-prompt" tabindex="-1" id="my-email">
            <div class="am-modal-dialog">
                <form class="am-form">
                    <legend style="font-size: 18px;padding: 12px 0;">选择邮箱</legend>
                    <div id="email">
                    <table class="am-table am-table-striped am-table-hover table-main">
                        <thead>
                        <tr>
                            <th class="table-check"></th>
                            <th class="table-title" style="text-align: center;">邮箱</th>
                        </tr>
                        </thead>
                        <tbody id="doc-modal-list">
                        <tr data-id="2" v-for="(allEmailData,index) in allEmailData">
                            <td >
                                <label class="am-radio">
                                    <input type="radio" name="radio1"  data-am-ucheck @click="choiceEmail(allEmailData.email_detail)">
                                </label>
                            </td>
                            <td class="am-hide-sm-only" >{{allEmailData.email_detail}}</td>
                        </tr>
                        </tbody>
                    </table>
                    </div>
                </form>
            </div>
        </div>
        <!-- 邮寄地址弹出框 -->
        <div class="am-modal am-modal-prompt" tabindex="-1" id="my-address">
            <div class="am-modal-dialog">
                <form class="am-form">
                    <legend style="font-size: 18px;padding: 12px 0;">选择邮寄地址</legend>
                    <div id="address">
                    <table class="am-table am-table-striped am-table-hover table-main">
                        <thead>
                        <tr>
                            <th class="table-check"></th>
                            <th class="table-title" style="text-align: center;">地址信息</th>
                        </tr>
                        </thead>
                        <tbody id="doc-modal-list">
                        <tr data-id="2" v-for="(allAddress) in allAddress">
                            <td>
                                <label class="am-radio">
                                    <input type="radio" name="radio1" data-am-ucheck @click="choiceAddress(allAddress.address_detail)">
                                </label>
                            </td>
                            <td class="am-hide-sm-only">{{allAddress.address_detail}}</td>
                        </tr>
                        </tbody>
                    </table></div>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="assets/js/jquery.min.js">
</script>
<script src="assets/js/amazeui.min.js"></script>
<script src="assets/js/app.js"></script>
<script src="assets/js/vue.js"></script>
<script src="assets/js/axios.min.js"></script>
<script>
    const opens = new Vue({
        el:"#open",
        data:{
        },
        methods:{
            open(){
                let _this = this;
                let formData = new FormData();
                formData.append("amount",ordersss.amount);
                formData.append("no",ordersss.no);
                formData.append("category",cateOne.choice);
                formData.append("type",cateTwo.choice);
                formData.append("address",updateBaseData.address);
                formData.append("email",updateBaseData.email);
                formData.append("title",updateBaseData.baseData.title);

                axios(
                    {method: "post",
                        url: "../admin/addInvoice.in",
                        data: formData
                    }
                ).then(function (response){
                   if(response.data.code === 700){
                       location.href="submit-success.html";
                   }else {
                       alert("当前无法开发票，请核查信息是否填写正确");
                       location.reload();
                   }
                })
            }
        },
    })
    const cateOne = new Vue({
        el:"#cate1",
        data:{
            choice:"0",

        },
        methods:{
            choiceOne(){
                this.choice = 0;
            },
            choiceTwo(){
                this.choice = 1;
            }
        }
    })
    const cateTwo = new Vue({
        el:"#cate2",
        data:{
            choice:"0"
        },
        methods:{
            choiceOne(){
                this.choice = 0;
            },
            choiceTwo(){
                this.choice = 1;
            }
        }
    })
    const ordersss = new Vue({
        el :"#orders",
        data: {
            show: false,
            page:{
                // no:"",
                // total_amount:"",
                // create_time:"",
            },
            amount:"",
            no:"",
        },
        methods:{
            toPage(pageNum) {
                let _this = this;
                if(pageNum == 0){
                    pageNum = 1;
                }
                if(pageNum > this.page.lastPage) {
                    pageNum = this.page.lastPage;
                }
                axios.get("../admin/list.order?currentPage=" + pageNum).then(function(response) {
                    if(response.data.value.data.length != 0){
                        _this.show = true;
                        _this.page = response.data.value;
                    }
                });
            },
            getOrder(no,amount){
                let _this = this;
                _this.amount = amount;
                _this.no = no;
            }
            },
        created() {
            let _this = this;
            axios.get("../admin/list.order").then(function(response) {
                let data = response.data;
                if(data.value.length != 0) {
                    _this.show = true;
                    _this.page = data.value;
                }
            })
        }
    });
    const addAddress = new Vue({
        el: "#address",
        data: {
            index :"0",
            allAddress: {},
        },
        methods: {
            choiceAddress(addresses){
                updateBaseData.address = addresses;
            },
        },
        created() {
            let _this = this;
            axios.post('../admin/listAddress.ad').then(function (response){
                let data = response.data;
                _this.allAddress = data.value;
            })
        },
    });
    const email = new Vue({
        el: "#email",
        data: {
            index: "0",
            allEmailData: {},
        },
        methods: {
            choiceEmail(emails){
                updateBaseData.email = emails;
            },
        },
        created() {
            let _this = this;
            axios.post('../admin/listAllEmail.email').then(function (response) {
                let data = response.data;
                _this.allEmailData = data.value;
            })
        },
    });
    // const orders = new Vue({
    //     el: "#order",
    //     data: {
    //         allOrder:{}
    //     },
    //     methods: {},
    //     created() {
    //         let _this = this;
    //         axios.post('../admin/listAllOrder.order').then(function (response) {
    //             let data = response.data;
    //             _this.allOrder = data.value;
    //         })
    //     },
    // });

    const updateBaseData = new Vue({
        el: "#baseData",
        data: {
            baseData: {
                name: "",
                title: "",
                taxNo: "",
                bankName: "",
                bankAccount: "",
                phone: "",
                address: "",
            },
            email:"",
            address:"",
        },
        methods: {},
        created() {
            let _this = this;
            axios.post('../admin/updateBaseData.bd').then(function (response) {
                let data = response.data;
                _this.baseData = data.value;
            })
        }
    });
</script>
<script>
    // 全选按钮添加改变事件
    $('input[name="checkAll"]').change(function(){
        if(this.checked){
            $('input[name="checkItem"]').prop('checked',true)
        }else{
            $('input[name="checkItem"]').prop('checked',false)
        }
    })
    $('input[name="checkItem"]').change(function(){
        let count = 0;
        $('input[name="checkItem"]').each(function(){
            if(this.checked){
                count++
            }
        })
        let length = $('input[name="checkItem"]').length;
        if(count == length){
            $('input[name="checkAll"]').prop('checked',true)
        }else{
            $('input[name="checkAll"]').prop('checked',false)
        }
    })
</script>
<script>
    var baseinfoDiv = document.getElementById('baseinfoDiv')
    var showDiv = document.getElementById('showDiv')
    var resultDiv = document.getElementById('resultDiv')
    resultDiv.style.display = 'none';
    // 提交按钮
    $(function () {
        $('#submitBtn').on('click', function () {
            baseinfoDiv.style.display = 'none';
            showDiv.style.display = 'none';
            resultDiv.style.display = 'block';
        });
    });
    // 邮寄地址选择按钮
    $(function () {
        $('#selectAddress').on('click', function () {
            $('#my-address').modal(
                {
                    relatedTarget: this,
                    onCancel: function (e) {
                    }
                });
        });
    });
    // 邮箱选择按钮
    $(function () {
        $('#selectEmail').on('click', function () {
            $('#my-email').modal(
                {
                    relatedTarget: this,
                    onCancel: function (e) {
                    }
                });
        });
    });

    // 发票类型切换
    function selectType(val) {
        if (val === 'ele') {
            $('#invoice_ele_addr').show();
            $('#invoice_paper_addr').hide();
        }else if (val === 'paper') {
            $('#invoice_ele_addr').hide();
            $('#invoice_paper_addr').show();
        }
    }
    function selectCategory(val) {
        if (val === 'ordinary') {
            $('#invoice_ordinary_title').show();
            $('#invoice_appropriative_title').hide();
        }else if (val === 'appropriative') {
            $('#invoice_ordinary_title').hide();
            $('#invoice_appropriative_title').show();
        }
    }
</script>
</body>

</html>